package com.baizhi.iox;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 追加写
 */
public class FileOutputStreamDemo3 {
    public static void main(String[] args) throws IOException {
        /*
          FileOutputStream(String name) 这个构造函数，每次写出内容都会覆盖上一次写出内容
          FileOutputStream(String name,boolean appean) 是否追加写
         */
        //FileOutputStream fos = new FileOutputStream("./javase_io/aaa.text");
        FileOutputStream fos = new FileOutputStream("./javase_io/aaa.text",true);

      //  fos.write("我爱你".getBytes());

      //  fos.write(",爱着你".getBytes());

        fos.write("就像老鼠爱大米".getBytes());

        fos.close();
    }
}
